import React from 'react';
import PropTypes from 'prop-types';
import SidebarGroup from '../components/SidebarGroup';

class MyWorkStatsComponent extends React.Component {
  constructor(props) {
    super(props);
  }

  render() {
    const { publishedCount, uploadsCount, likesCount } = this.props;
    const mappedItems = [
      {
        itemId: 'myPublished',
        itemName: '已发布',
        itemLink: '/my/published',
        itemRightSideNote: publishedCount,
      }, {
        itemId: 'myUploads',
        itemName: '已上传',
        itemLink: '/my/uploads',
        itemRightSideNote: uploadsCount,
      }, {
        itemId: 'myLikes',
        itemName: '收藏',
        itemLink: '/my/likes',
        itemRightSideNote: likesCount,
      },
    ];
    return (
      <SidebarGroup groupName="我的" items={mappedItems} />
    );
  }
}

MyWorkStatsComponent.propTypes = {
  publishedCount: PropTypes.number,
  uploadsCount: PropTypes.number,
  likesCount: PropTypes.number,
};

export default MyWorkStatsComponent;
